package tuiLayer;
//import modelLayer.*;
//import controlLayer.*;
import java.util.Scanner;
public class MainMenuUI
{
    private DVDUI dvd;
    private PersonUI personUI;
    private LoanUI loan;
    public MainMenuUI()
    {
        dvd = new DVDUI();
        loan = new LoanUI();
        personUI = new PersonUI();
    }
    
    public void start()
    {       
        menuSelector();
    }
    
    public void menuSelector()
    {        
       boolean exit = false;
       while(!exit)//that is: while exit is false
       {
          
           String choise = subMenus();
           switch(choise)
           {
               case "1":
               System.out.print('\u000C');
               personUI.personUIMenu();
               break;
               case "2": 
               dvd.dvdMenu();
               break;
               case "3": 
               System.out.println(" (3) Loan Menu");
               loan.loanMenu();
               break;
               case "4": exit = true;
               break;
               default:
               break;
           }
       }
    }
        
    public String subMenus()
    {      // makes an object keyboard to read input from the screen
       System.out.print('\u000C');
       Scanner keyboard = new Scanner(System.in);
       System.out.println("*** Kunde Menu ***");
       System.out.println(" (1) Friends Menu");
       System.out.println(" (2) DVD Menu");
       System.out.println(" (3) Loan Menu");
       System.out.println(" (4) Close");
       System.out.print("\n Choose: ");
            
       String choise = keyboard.next();
       return choise;
    }
    
    
}
